package co.fitstart.admin.service;

import java.util.Date;
import java.util.List;

import com.demo2do.core.support.Page;

import co.fitstart.admin.entity.search.AgentSearch;
import co.fitstart.entity.order.Order;
import co.fitstart.entity.user.agent.Agent;
import co.fitstart.entity.user.agent.AgentDiscount;
import co.fitstart.entity.user.agent.AgentRecord;
import co.fitstart.entity.user.agent.DiscountType;
import co.fitstart.entity.user.agent.RecordType;

public interface AgentService {
    
    /**
     * 
     * @param page
     * @return
     */
    public List<Agent> listAgent(Page page);
    
    /**
     * 
     * @return
     */
    public List<Agent> listAgent();
    
    /**
     * 
     * @param agentSearch
     * @param page
     * @return
     */
    public List<Agent> search(AgentSearch agentSearch, Page page);
    
    /**
     * 
     * @param userId
     * @return
     */
    public Agent loadAgentByUserId(Long userId);
    
    /**
     * 
     * @param agentId
     * @return
     */
    public Agent loadAgent(Long agentId);
    
    /**
     * 
     * @param agent
     * @param discountType
     * @param discountOffer
     * @param commission
     * @param agentDiscount
     * @param userDiscount
     */
    public void create(Agent agent, DiscountType discountType, String discountOffer, String commission, Integer agentDiscount, String userDiscount);
    
    /**
     * 
     * @param agent
     */
    public void deleteAgent(Agent agent);
    
    /**
     * 
     * @param agent
     * @return
     */
    public List<AgentDiscount> listAgentDiscount(Agent agent);
    
    /**
     * 
     * @param agent
     * @return
     */
    public List<Order> listAgentOrder(Agent agent);
    
    /**
     * 
     * @param agent
     * @param discountType
     * @param discount
     * @param commission
     */
    public void createAgentDiscount(Agent agent, DiscountType discountType, String discount, String commission);
    
    /**
     * 
     * @param agentDiscount
     */
    public void deleteAgentDiscount(AgentDiscount agentDiscount);
    
    /**
     * 
     * @param agent
     * @param page
     * @return
     */
    public List<AgentRecord> listAgentRecord(Agent agent, Page page);
    
    /**
     * 
     * @param recordType
     * @param page
     * @return
     */
    public List<AgentRecord> listAgentRecord(RecordType recordType, Page page);
    
    /**
     * 
     * @param type
     * @param beginTime
     * @param endTime
     * @return
     */
    public List<AgentRecord> listAgentRecord(RecordType type, Date beginTime, Date endTime);
    
    /**
     * 
     * @param agentRecordId
     * @return
     */
    public AgentRecord loadAgentRecord(Long agentRecordId);
    
    /**
     * 
     * @param agent
     * @param agentRecord
     */
    public void pay(Agent agent, AgentRecord agentRecord);
    
}
